package com.example.MatchGame;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;

import com.example.Resizablecontrol.ResizableImageView;
import com.example.wonderfulradish.R;
//选关界面的设置
public class Match_radish extends AppCompatActivity implements View.OnClickListener{

    private Animation matchAnimation;
    private ResizableImageView matchradishPlay;
    private Button startSelectGame;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_match_radish);
        startSelectGame=(Button) findViewById(R.id.start_select_game);
        startSelectGame.setOnClickListener(this);
        //初始化动画
        matchAnimation= AnimationUtils.loadAnimation(this,R.anim.select_anim);
        matchradishPlay=(ResizableImageView)this.findViewById(R.id.match_radish_play);
        matchradishPlay.startAnimation(matchAnimation);
        matchAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                Intent intent=new Intent(Match_radish.this,MatchSelecte.class);
                startActivity(intent);
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
    }

    public void onClick(View v){
        switch (v.getId()){
            case R.id.start_select_game:
                Intent intent=new Intent(Match_radish.this,MatchSelecte.class);
                startActivity(intent);
                break;
            default:
                break;
        }
    }
}
